package com.example.user.dao.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("permission")
public class Permission {
    @TableId(type = IdType.AUTO)
    private Long id;

    @TableField("perm_key")
    private String permKey;

    private String description;

    @TableField("is_pattern")
    private Integer isPattern;

    private String module;
    private Integer status;

    @TableField("create_time")
    private Date createTime;

    @TableField("update_time")
    private Date updateTime;
}

//CREATE TABLE `permission` (
//    `id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '主键ID',
//    `perm_key` VARCHAR(50) NOT NULL COMMENT '权限标识符',
//    `description` VARCHAR(255) NOT NULL COMMENT '权限描述',
//    `is_pattern` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '是否通配权限(0-否 1-是)',
//    `module` VARCHAR(50) NOT NULL COMMENT '所属模块',
//    `status` TINYINT(1) NOT NULL DEFAULT 1 COMMENT '状态(1-启用 0-禁用)',
//    `create_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
//    `update_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
//    PRIMARY KEY (`id`),
//    UNIQUE INDEX `uniq_perm_key` (`perm_key`),
//    INDEX `idx_module` (`module`),
//    INDEX `idx_status` (`status`)
//    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='系统权限表';